home *** CD-ROM | disk | FTP | other *** search
/ Video Toaster 4.2 / Video Toaster v4.2.iso / arexx / editor / prepstills.rexx < prev    next >
OS/2 REXX Batch file  |  1996-03-14  |  3KB  |  115 lines

  1. /* PrepStills.rexx V3.0 -- Change still and framestore duration.          */
  2. /* By Bob Caron (Grue) ©1995 NewTek Inc. (Suggested by Azar)              */
  3.  
  4. arg frompopup
  5. if frompopup="" then frompopup=0
  6.  
  7. call remlib('PROJECT_REXX_PORT')
  8.  
  9. call addlib('PROJECT_REXX_PORT',0)
  10. call set_view(2)
  11.  
  12. call req_error("Prep Stills V3.0     ---    Batch change flyer stills & Framestore duration in a project (Time is in seconds).")
  13.  
  14. done=0
  15. do while done=0
  16.   selection=req_tell("Prep Stills V3.0","'Continue' to effect ALL croutons","'Cancel' to effect selected croutons")
  17.   done=1
  18.   if selection=0 & frompopup=0 then do
  19.     if req_tell("Error:","You can only use this feature if you","launch this script from the tools","popup menu.")=0 then call quit()
  20.     done=0
  21.     end
  22. end
  23. if selection=1 then frompopup=0 else frompopup=1
  24.  
  25. project_end=croutonsinproject()
  26. location=1
  27. do count=1 to project_end
  28.   if croutonselectedpos(count)=1 | frompopup=0 then do
  29.      selected.location=count-1
  30.      location=location+1
  31.      end
  32. end
  33.  
  34. location=location-1
  35.  
  36. time=req_time("Enter duration",30)
  37. if time="CANCEL" then call quit()
  38.  
  39. hours=substr(time,1,2)
  40. minutes=substr(time,4,2)
  41. seconds=substr(time,7,2)
  42. frames=substr(time,10,2)
  43.  
  44. fields=D2F((hours*216000)+(minutes*3600)+(seconds*60)+(frames*2))
  45.  
  46. stuff=-1;framestores=0;stills=0
  47. buttons='11'
  48. do while stuff=-1
  49.   buttons=req_buttons("Choose type:",buttons,"Flyer Stills","Framestores")
  50.   if buttons="CANCEL" then call quit
  51.  
  52.   if buttons="10" then do
  53.      stills=1
  54.      stuff=1
  55.      end
  56.   if buttons="01" then do
  57.      framestores=1
  58.      stuff=1
  59.      end
  60.   if buttons="11" then do
  61.      framestores=1
  62.      stills=1
  63.      stuff=1
  64.      end
  65. end
  66.  
  67. if frompopup="0" then do
  68.    if req_tell("Change ALL Framestores/Stills","            Are You Sure?")=0 then call quit()
  69. end
  70. else
  71.    if req_tell("Change Selected Framestores/Stills.","            Are You Sure?")=0 then call quit()
  72.  
  73. call req_open("Working... Please wait.")
  74. chunk=100/location;last=0;dots=0
  75. do count=1 to location
  76.    if (crnumtype(selected.count)="STIL" & stills=1) | (crnumtype(selected.count)="FRAM" & framestores=1) then do
  77.       call crnumsettag(selected.count,Duration,fields)
  78.       end
  79.       last=trunc(dots/10)+1
  80.       dots=dots+chunk;string=copies(".",trunc(dots/10)+1)
  81.       if (last~=trunc(dots/10)+1) then do
  82.          if (11-length(string)>-1) then
  83.             call req_error("[Working"||string||right('           ',11-length(string))||"]")
  84.          end
  85. end
  86. call req_close()
  87.  
  88. call req_error("All done.")
  89. call projectupdate()
  90. call remlib("PROJECT_REXX_PORT")
  91. exit
  92.  
  93. quit:
  94.  
  95. call req_error("Canceled.")
  96. call remlib("PROJECT_REXX_PORT")
  97.  
  98. exit
  99.  
  100. croutonselectedpos:
  101. arg pos
  102. row=trunc(pos/8)
  103. col=pos-(row*8)
  104. row=row+1
  105. return croutonselected(row,col)
  106.  
  107. D2F: procedure /* Convert dropframe to fields */
  108. parse arg ticks
  109.  
  110.    mins=ticks%1800
  111.    if (ticks>0) then return( ticks - (mins*2) + 2*(mins%10) )
  112.  
  113.    return(0) /* Dropframe is a major PAIN!!! */
  114. }
  115.